import { defineComponent, onMounted, reactive } from 'vue'
import Draw from './draw'

export default defineComponent({
  components: {
    Draw,
  },
  setup() {
    const cdata = reactive({
      idnex:0,
      dataSJB:[
        [1981, 1, 93.33, 94.3, ],
        [1985, 1, 92.25, 92.2, ],
        [1989, 3, 91.08, 91.7, ],
        [1991, 2, 92.25, 92.9,],
        [1995, 3, 92, 91.5, ],
        [1999, 5, 92.92, 92.9, ],
        [2003, 1, 93.83, 93.8, ],
        [2011, 3, 92.36, 91.8, ],
        [2015, 1, 93.14, 93.7, ],
        [2019, 1, 95.25, 95.3, ],
      ],
      dataSJS:[
        [1982, 1, 93.5, 93.8, ],
        [1986, 1, 92.75, 92.9,],
        [1990, 2, 92.17, 93.1, ],
        [1994, 8, 92.92, 92.9, ],
        [1998, 2, 94.08, 93.5, ],
        [2002, 4, 93, 93.5, ],
        [2006, 5, 95.08, 94.4, ],
        [2010, 10, 94.08, 92.8, ],
        [2014, 2, 93.14, 92.7, ],
        [2018, 3, 94.21, 94.5, ],
      ],
      dataAYH:[
        [1984, 1, 93.5, 93.4, ],
        [1988, 3, 93, 93.5,],
        [1992, 7, 93, 93.6, ],
        [1996, 2, 92.75, 92.2, ],
        [2000, 5, 94.69, 93.5, ],
        [2004, 1, 94.83, 94.9, ],
        [2008, 3, 96, 95.1, ],
        [2012, 7, 94.33, 93.8, ],
        [2016, 1, 94.42, 94.3, ],
        [2020, 9, 96.33, 97.1, ],
      ],
      dataDJS:[
        [1993, 12, 92.45, 93.3, ],
        [1994, 13, 93, 93.3,],
        [1995, 14, 92, 91.5, ],
        [1996, 4, 92.75, 92.2, ],
        [1997, 15, 91.92, 91.9, ],
        [1998, 14, 93.2, 92.7, ],
        [1999, 13, 92.75, 92.1, ],
        [2000, 14, 93.72, 94.3, ],
        [2001, 12, 92.2, 92.8, ],
        [2002, 12, 92.56, 93.1, ],
        [2003, 11, 93.75, 94.1, ],
        [2004, 6, 94.38, 94.7, ],
        [2005, 8, 92.67, 92.6, ],
        [2006, 5, 94.67, 94, ],
        [2007, 12, 93.87, 93.8, ],
        [2008, 15, 96, 95.1, ],
        [2009, 13, 92, 91.8, ],
        [2010, 4, 92.44, 91.9, ],
        [2011, 8, 92.3, 91.9, ],
        [2012, 15, 93.52, 93, ],
        [2013, 12, 92.72, 93.5, ],
        [2014, 9, 92.38, 92.7, ],
        [2015, 14, 92.6, 92.4, ],
        [2016, 12, 93.95, 94.2, ],
        [2017, 14, 92.29, 92.7, ],
        [2018, 13, 93.92, 93.7, ],
        [2019, 13, 92.86, 93.9, ],
        [2021, 7, 95.56, 96, ],
      ]
    })
     
    const setData = () => {
      cdata.idnex = 1
    }

    onMounted(() => {
      setData()
    })
    return {
      cdata,
      setData
    }
  },
  render(){
    return <div>
      <Draw cdata={this.cdata} />
    </div>
  }
})
